package com.vote.wx.controller;

import com.vote.common.annotation.Anonymous;
import com.vote.common.core.controller.BaseController;
import com.vote.common.core.domain.ResponseResult;
import com.vote.wx.service.ApiUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WanShen
 * @date 2024年01月10日 15:53
 */
@RestController
@RequestMapping("/oauth")
public class ApiJustAuthController extends BaseController {


    @Autowired
    private ApiUserService userService;

    /**
     * 判断用户是否微信登录成功
     * @author WanShen
     * @date 2024/1/10 15:56
     * @param loginCode
     * @return ResponseResult
     */
    @Anonymous
    @RequestMapping("/wechat/is_login")
    public ResponseResult wxIsLogin(String loginCode) {
        return userService.wxIsLogin(loginCode);
    }
    /**
     * 获取微信登录验证码
     * @author WanShen
     * @date 2024/1/10 15:56
     * @return ResponseResult
     */
    @RequestMapping("/wechatLoginCode")
    @Anonymous
    public ResponseResult getWechatLoginCode() {
        return userService.getWechatLoginCode();
    }


}
